package utils;

import java.util.Base64;

public class SecretUtil {
    public static String encryptBase64(String s) {
        StringBuilder sb = new StringBuilder();
        for (byte b : Base64.getEncoder().encode(s.getBytes())) {
            sb.append((char) b);
        }
        return sb.toString();
    }

    public static String decryptBase64(String s){
        StringBuilder sb = new StringBuilder();
        for (byte b : Base64.getDecoder().decode(s)) {
            sb.append((char) b);
        }
        return sb.toString();
    }
}
